<template>
    <div>
            <!--面包屑-->
        <el-breadcrumb separator="/" class="margin-bottom">
            <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item><a href="/">权限管理</a></el-breadcrumb-item>
            <el-breadcrumb-item>权限列表</el-breadcrumb-item>
        </el-breadcrumb>

        <!--表格-->
        <el-table
                :data="tableData"
                border
                style="width: 100%">
            <el-table-column
                    type="index"
                    width="50">
            </el-table-column>
            <el-table-column
                    prop="authName"
                    label="权限名称"
                    >
            </el-table-column>
            <el-table-column
                    prop="path"
                    label="路径"
                    >
            </el-table-column>
            <el-table-column
                    prop="level"
                    label="等级">
                <template slot-scope="scope">
                    <span v-if="scope.row.level==='0'">第一等级</span>
                    <span v-if="scope.row.level==='1'">第二等级</span>
                    <span v-if="scope.row.level==='2'">第三等级</span>

                </template>
            </el-table-column>
        </el-table>
    </div>

</template>

<script>
    export default {
        name: "rightlist",
        data() {
            return {
                tableData: []
            }
        },
        methods:{
            getRightList(){
                this.$myhttp({
                    url:'rights/list',
                    method:'get',
                }).then((respon)=>{
                    let {data,meta}=respon.data;
                    console.log(respon);
                    if(meta.status===200){
                        this.tableData=data;
                    }
                })
            }

        },
        mounted(){
            this.getRightList();
        }

    }
</script>

<style scoped>
.margin-bottom{
    margin-bottom:20px;
}
</style>
